<%@ page language="java" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 
<script language="JavaScript">
   function doSubmit(theForm, cntType, cntOID, catOID, exitURL){
     if (theForm.selectedOid.value == null || theForm.selectedOid.value == "" ) {
        alert('<bean:message bundle='cm.messages' key="error.content.review.empty"/>');
        return false;
     }
     var theURL ="/cm/launchBVCWebflow.do";
     var theParam="";
     if ( (theForm.contentAction.value == 'CreateContent') || 
          (theForm.contentAction.value == 'CreateSubcategory') ) {
        theParam="?ssp_process_oid="+theForm.selectedOid.value+"&contentTypeId="+cntType+"&categoryOID="+catOID+"&exitURL="+exitURL; 
      } else {
        var theParam="?ssp_process_oid="+theForm.selectedOid.value+"&contentTypeId="+cntType+"&contentOID="+cntOID+"&exitURL="+exitURL; 
      }
     theForm.action='<html:rewrite page="'+theURL+'" />'+theParam;

     theForm.method = "post";
     theForm.submit();
     return false;
   }

   function closeWindow() {
     self.close();
   }

</script>

<jsp:useBean id="cmBVCProcessMappingView" scope="request" type="com.broadvision.web.util.ViewDynaBean"/> 

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr> 
  <td valign="top" width="100%">
		  
  <div class="pageTitle"><bean:message bundle="cm.messages" key="cm.content.processmapping.pageTitle" /></div>
  <div class="errorMessage"><html:errors bundle="cm.messages"/></div>

  <div class="pageSubtitle">
    <span class="left"><bean:message bundle="cm.messages" key="cm.content.processmapping.process" /></span>
    <span class="right">&nbsp;</span>
  </div> 
           
<html:form action="/cm/cmBVCProcessMapping.do">
  <html:hidden  property="contentAction" />
  <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="Form detail information">
    <tr>
      <td valign="top" width="20%" class="label"><bean:message bundle="cm.messages" key="cm.content.contentName" />:</td>
      <td valign="top" class="labelField" width="80%"><bean:write name="cmBVCProcessMappingView" property="key"/></td>
    </tr>
    <tr>
       <td width="20%" class="label"><bean:message bundle="cm.messages" key="cm.content.processModelName" />:</td>
       <td class="labelField" width="80%">

	<html:select property="selectedOid">
  	  <html:optionsCollection name="cmBVCProcessMappingView" property="options"/>
	</html:select>

        </td>
      </tr> 
      <tr>
        <td class="label" width="20%">&nbsp;</td>
        <td class="labelField" width="80%">
          <html:button property="closeWinBtn" styleClass="inputButton" onclick="javascript:closeWindow()">
            <bean:message bundle='cm.messages' key='button.cancel' />
          </html:button>

          <input type="button" class="titleButton" name="submitForReviewButton"
             value='<bean:message bundle="cm.messages" bundle="cm.messages" key="button.submit"/>' 
              onclick="return doSubmit(this.form,'<bean:write name="cmBVCProcessMappingView" property="contentType"/>','<bean:write name="cmBVCProcessMappingView" property="contentOID"/>','<bean:write name="cmBVCProcessMappingView" property="categoryOID"/>','<bean:write name="cmBVCProcessMappingForm" property="exitURL"/>')" /> 
        </td>
      </tr> 

  </table>
</html:form>
		  
  <br>
		  
  </td>
  </tr>
</table>  
